#include <memory>
#include "HttpServer.hpp"

void Usage(const char *process)
{
    std::cout << "usage: \n\t";
    std::cout << process << " port[1024+]\n"
              << std::endl; // 输出内容最后可加一个\n换行，这样更美观
}

// ./server port
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(0);
    }
    uint16_t port = std::stoi(argv[1]);
    std::unique_ptr<HttpServer> up(new HttpServer(port));
    up->Start();

    return 0;
}